{% extends 'admin/manager.html' %}

{% block app_content %}
<div class="container mb-4"></div>
    <h1 class="display-6" align="center">管理员管理</h1>
    <div class="container mb-4"></div>
<form action="/add_manage" method="POST">
    <div class="form-row">
<div class="col">
        <input type="number" name="ManagerNum" class="form-control" placeholder="工号" required>
      </div>

      <div class="col">
        <input type="text" name="ManagerName" class="form-control" placeholder="姓名" required>
      </div>
      <div class="col">
        <select type="text" name="ManagerSex" class="form-control custom-select" placeholder="性别" required>
            <option>男</option>
            <option>女</option>
        </select>
    </div>
<div class="col">
      <button type="submit" class="btn btn-block btn-dark mb-2">录入</button>
      </div>
        </div>
  </form>
    <hr>
    <div class="container mb-4"></div>
    <div class="row">
            <table class="table table-striped table-hover">
                    <thead class="thead-dark">
                        <tr>
                            <th class="lead">工号</th>
                            <th class="lead">姓名</th>
                            <th class="lead">性别</th>
                            <th class="lead">管理</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% if students %}
                            {% for student in students %}
                            <tr>
                               <td class="lead">{{ student.ManagerNum }}</td>
                               <td class="lead">{{ student.ManagerName }}</td>
                               <td class="lead">{{ student.ManagerSex }}</td>

                                <td class="lead">
                                    <a href="{{ url_for("delete_manager",ManagerNum=student.ManagerNum) }}" class="btn btn-outline-danger btn-sm" role="button">删除</a>
                                </td>
                            </tr>

                            {% endfor %}
                        {% endif %}
                    </tbody>
            </table>
    </div>
{% endblock %}